Compliance Auditor
AI-powered document compliance analysis application built with Next.js, Supabase, and OpenAI/Anthropic.
Features
- Document Upload: Support for PDF, Word documents (.docx), and text files
- AI-Powered Analysis: Automatic compliance risk detection using OpenAI GPT-4 or Anthropic Claude
- Risk Detection: Identifies PII, financial data exposure, GDPR/CCPA issues, security vulnerabilities, and contract risks
- User Authentication: Secure authentication with Supabase Auth
- Dashboard: Overview of all documents and compliance status
- Detailed Reports: Risk flags with severity ratings and actionable recommendations
Tech Stack
- Frontend: Next.js 14 (App Router), React 18, TypeScript
- Styling: Tailwind CSS, Shadcn UI
- Backend: Next.js API Routes
- Database: Supabase (PostgreSQL)
- Storage: Supabase Storage
- Authentication: Supabase Auth
- AI Providers: OpenAI GPT-4, Anthropic Claude
Getting Started
Prerequisites
- Node.js 18+
- npm
- Supabase account
- OpenAI API key and/or Anthropic API key
Quick start (new project setup)
-
Clone and enter the repository:
bash git clone <your-repo-url> cd <your-repo-directory> -
Run the bootstrap script:
bash bash scripts/bootstrap.sh -
Update
.env.localwith real values:env NEXT_PUBLIC_SUPABASE_URL=your_supabase_url NEXT_PUBLIC_SUPABASE_ANON_KEY=your_supabase_anon_key SUPABASE_SERVICE_ROLE_KEY=your_supabase_service_role_key OPENAI_API_KEY=your_openai_api_key ANTHROPIC_API_KEY=your_anthropic_api_key -
Set up the database by running
supabase/schema.sqlin Supabase SQL Editor. -
Start the development server:
bash npm run dev -
Open http://localhost:3000 in your browser.
Project Structure
.
βββ app/
β βββ (auth)/ # Auth pages (login, signup)
β βββ (dashboard)/ # Protected dashboard pages
β βββ api/ # API routes
β βββ auth/ # Auth callback handler
βββ components/
β βββ ui/ # Shadcn UI components
β βββ ... # Custom components
βββ lib/
β βββ ai/ # AI provider integrations
β βββ parsers/ # Document parsers (PDF, DOCX, TXT)
β βββ supabase/ # Supabase client configurations
βββ scripts/
β βββ bootstrap.sh # First-time setup helper
βββ supabase/
β βββ schema.sql # Database schema
βββ types/
βββ index.ts # TypeScript type definitions
Usage
- Sign Up/Login: Create an account or sign in
- Upload Documents: Navigate to Upload and drag & drop your files
- View Analysis: Documents are automatically analyzed after upload
- Review Risks: Click on a document to see detailed risk findings
- Configure AI: Go to Settings to switch between OpenAI and Anthropic
API Routes
POST /api/upload- Upload and process a documentPOST /api/analyze- Trigger AI analysis on a documentGET /api/documents- List user's documentsDELETE /api/documents?id=<id>- Delete a documentPOST /api/reanalyze- Re-run analysis on a document
Security
- Row Level Security (RLS) ensures users can only access their own data
- Files are stored in private Supabase Storage buckets
- API keys are kept server-side only
- Authentication is required for all protected routes
License
MIT